package com.atguigu.tingshu.order.pattern.factory;

import com.atguigu.tingshu.order.pattern.TradeStrategy;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Slf4j
@Component
public class TradeStrategyFactory {


    @Autowired
    private Map<String, TradeStrategy> tradeStrategyMap;

    public TradeStrategy getTradeStrategy(String itemType){

        return tradeStrategyMap.get(itemType);
    }

}
